# 读取文件并存储为字典
filename = 'counter_output.txt'
item_count_dict = {}

with open(filename, 'r') as file:
    for line in file:
        # 去掉行尾的换行符并分割item和count
        item, count = line.strip().split(':')
        # 将count转换为整数并存入字典
        item_count_dict[item] = int(count)

# 找出count最大的五个item
top_5_items = sorted(item_count_dict.items(), key=lambda x: x[1], reverse=True)[:10]

# 输出结果
for item, count in top_5_items:
    print(f"{item}: {count}")
